// import com.alibaba.druid.sql.ast.expr.SQLIdentifierExpr;
// import com.alibaba.druid.sql.ast.expr.SQLIntegerExpr;

#pragma once

#include <list>
#include "SQLObjectImpl.h"

class SQLSubPartitionBy;
class SQLPartition;
class SQLName;
class SQLExpr;
class SQLIntegerExpr;

class SQLPartitionBy
    : virtual public SQLObjectImpl
{
public:
  SQLSubPartitionBy_ptr subPartitionBy;
  SQLExpr_ptr partitionsCount;
  BOOL_ptr linear;
  SQLPartition_list_ptr partitions;
  SQLName_list_ptr storeIn;
  SQLExpr_list_ptr columns;

  SQLIntegerExpr *lifecycle;

  SQLPartitionBy();
  SHAREDOBJECT(SQLPartitionBy);
  SQLPartition_list_ptr getPartitions();

  void addPartition(SQLPartition_ptr partition);

  SQLSubPartitionBy_ptr getSubPartitionBy();

  void setSubPartitionBy(SQLSubPartitionBy_ptr subPartitionBy);

  SQLExpr_ptr getPartitionsCount();

  void setPartitionsCount(SQLExpr_ptr x);

  void setPartitionsCount(int partitionsCount);

  BOOL_ptr isLinear();

  void setLinear(BOOL_ptr linear);

  SQLName_list_ptr getStoreIn();

  SQLExpr_list_ptr getColumns();

  void addColumn(SQLExpr_ptr column);

  void cloneTo(SQLPartitionBy_ptr x);

  BOOL_ptr isPartitionByColumn(long columnNameHashCode64);

  SQLIntegerExpr *getLifecycle();

  void setLifecycle(SQLIntegerExpr *lifecycle);

  virtual SQLObject_ptr clone()
  {
    SQLObject_ptr clone_tmp = std::shared_ptr<SQLPartitionBy>(new SQLPartitionBy());
    std::shared_ptr<SQLPartitionBy> clone_res = std::dynamic_pointer_cast<SQLPartitionBy>(clone_tmp);

    return clone_res;
  }
};
